package sample;

import java.util.List;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Text;

/**
 * Blip Record
 * @author ago
 *
 */
@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class BlipRecord {
  @PrimaryKey
  @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
  private String blipId;
  
  @Persistent
  private String waveId;
    
  @Persistent
  private String author;
  
  @Persistent
  private Text content;
  
  @Persistent
  private String parentBlipId;
  
  @Persistent
  private List<String> childBlipIds;

  @Persistent
  private int level;
  
  public BlipRecord(String blipId, String waveId, String author, String content, String parentBlipId, List<String> childBlipIds, int level) {
    this.blipId = blipId;
    this.waveId = waveId;
    this.author = author;
    this.content = new Text(content);
    this.parentBlipId = parentBlipId;
    this.childBlipIds = childBlipIds;
    this.level = level;
  }

  public String getBlipId() {
    return blipId;
  }

  public String getWaveId() {
    return waveId;
  }

  public String getAuthor() {
    return author;
  }

  public Text getContent() {
    return content;
  }

  public String getParentBlipId() {
    return parentBlipId;
  }

  public List<String> getChildBlipIds() {
    return childBlipIds;
  }

  public int getLevel() {
    return level;
  }
}
